package com.hc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * @author hs
 * @date 2021/05/02
 */
@Controller
public class HelloController {

    @RequestMapping("/hello")
    public String testThymeleaf(Model model){
        model.addAttribute("mesg","<h1>hello,springboot<h1>");
        //测试前端遍历数据
        List list = new ArrayList(5);
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        model.addAttribute("list",list);
        return "helloThymeleaf";
    }



}
